<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ page import="org.apache.log4j.Logger;"  %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page errorPage="error.jsp" %>

<c:set var="avaliableCars"
		value="${sessionScope.carRentAppModel.getAvaliableCars()}" />

<html>
<head>
<title>Car Rent 1.0</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<style type="text/css">
body,table,hr {
	color: black;
	background: silver;
	font-family: Verdana, sans-serif;
	font-size: x-small;
}
</style>
</head>

<body>
	<h2>Car Rent 1.0</h2>
	<a href="defaultAction.perform">Go to Start</a>
	<fieldset>
		<legend>
			<b>Please fill </b>
		</legend>
		<form method="post" action="requestHandlerAction.perform">
			<table>
				<tr>
					<td>Name:</td>
					<td><input type="text" size="30" name="name"></td>
				</tr>
				<tr>
					<td>Passport:</td>
					<td><input type="text" size="30" name="passport" /></td>
				</tr>
				<tr>
					<td>Car:</td>
					<td><select size="1" name="carID">
							<c:forEach items="${avaliableCars}" var="car">
								<option value="${car.getID()}">${car}</option>
							</c:forEach>
					</select></td>
				</tr>
				<tr>
					<td>Rent Duration:</td>
					<td><select size="1" name="rentDuration">
							<c:forEach var="duration" begin="1" end="7">
								<option value="${duration}">${duration}</option>
							</c:forEach>
					</select></td>
				</tr>
			</table>
			<br /> <input type="submit" name="request a car "
				value="  REQUEST A CAR  ">
		</form>
	</fieldset>
</body>
</html>